const gulp = require('gulp');
var gp = require('gulp-load-plugins')();

var jsHintOpt = {
    node: true,
    browser: true,
    esnext: true,
    bitwise: true,
    curly: true,
    // eqeqeq: true,
    immed: true,
    // indent: 4,
    latedef: true,
    // newcap: true,
    noarg: true,
    // quotmark: 'single',
    regexp: true,
    undef: true,
    unused: true,
    trailing: true,
    smarttabs: true
    // strict: true
};

var logfile = __dirname + '/jshint-output.log';

gulp.task('lint', function () {
    return gulp.src('../tax-xa/tax/src/main/webapp/js/app/**/*.js')
        .pipe(gp.jshint(jsHintOpt))
        .pipe(gp.jshint.reporter('jshint-stylish'))
        // .pipe(gp.jshint.reporter('fail'))
        .pipe(gp.jshint.reporter('gulp-jshint-file-reporter', {
            filename: logfile
        }));
});

gulp.task('default', ['lint']);
console.log(logfile);